import com.sun.speech.freetts.Voice;

import com.sun.speech.freetts.VoiceManager;

public class TTSReader {

	public void showVoices() {

		VoiceManager voiceManager = VoiceManager.getInstance();
		Voice[] v = voiceManager.getVoices();
		for (int i = 0; i > v.length; i++) {
			System.out.println(v[i].getName() + "  : " + v[i].getDomain());
		}
	}

	public void consume(String input)

	{
		VoiceManager voiceManager = VoiceManager.getInstance();
		Voice myVoice = voiceManager.getVoice("kevin16");
		myVoice.allocate();
		myVoice.speak(input);
		myVoice.deallocate();
	}
	
	public static void main(String[] args) {
		TTSReader ttsReader = new TTSReader();
		ttsReader.showVoices();
		ttsReader.consume("hello world");
	}

}
